package com.howard.jms;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.TextMessage;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 *
 * @author Howard.He
 *
 */
public class LogListenerImpl implements LogListener {

	private static Logger logger = LoggerFactory.getLogger(LogListener.class);

	@Override
	public void onMessage(Message message) {
		if(message instanceof TextMessage) {
			try {
				String str = ((TextMessage) message).getText();
				logger.info("LogListender onMessage: " + str);
			} catch (JMSException e) {
				e.printStackTrace();
			}
		}
	}

	@Override
	public void proess(String message) {
		logger.info("LogListender proess : " + message);
	}

}
